package edu.ts.crowdfunding.category.mapper;

import edu.ts.crowdfunding.category.domain.Category;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import edu.ts.crowdfunding.category.domain.ItemCountInCategory;
import org.apache.ibatis.annotations.Delete;
import edu.ts.crowdfunding.category.domain.PO.CategoryConditionalQueryPO;
import edu.ts.crowdfunding.category.domain.PO.CategoryConditionalQueryPO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
* @author Lenovo
* @description 针对表【project_category】的数据库操作Mapper
* @createDate 2025-06-25 19:25:59
* @Entity edu.ts.crowdfunding.category.domain.Category
*/
@Mapper
public interface CategoryMapper extends BaseMapper<Category> {

    //在分类表中根据分类id删除分类，同时删除该分类下的所有产品
    @Delete("delete from project_category where category_id = #{id}")
    void deleteWithProducts(Long id);

    List<Category> pageSearch(CategoryConditionalQueryPO categoryConditionalQueryPO);

    List<ItemCountInCategory> getItemCoutInCategory();
}




